<template>
  <div class="container">
    <el-dialog title="查看订单" :visible.sync="option.show" @open="getData" center>
      <el-table :data="tableData" border style="width: 100%" empty-text="暂无数据">
        <el-table-column prop="apfromorgcode" label="订单code" align="center"></el-table-column>
        <el-table-column prop="orgname" label="店铺名称" align="center"></el-table-column>
        <el-table-column prop="count" label="状态" align="center">
          <template slot-scope="scope">
               <div>
                {{ 
                  scope.row.status == 0 && '待提交' ||
                  scope.row.status == 1 && '待发货' ||
                  scope.row.status == 2 && '已发货' ||
                  scope.row.status == 3 && '已收货​' || ''
                }} 
                </div> 
          </template>
          
        </el-table-column>
        <el-table-column prop="qty" label="要货数量" align="center"></el-table-column>
        <el-table-column prop="pick_qty" label="配货数量" align="center"></el-table-column>
        <el-table-column prop="enquiry_time" label="要货时间" align="center"></el-table-column>
      </el-table>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="confirm">关 闭</el-button>
      </div>
    </el-dialog>
  </div>
</template>
<script>
import { getGoodsOrder } from "@/api/enquiry/enquiryList";

export default {
  props: {
    option: Object
  },
  data() {
    return {
      tableData: [],
    };
  },
  methods: {
    confirm() {
      this.option.show = false;
    },
    getData() {
      getGoodsOrder(this.option.data).then(res => {
        if (res.code == 0) {
          this.tableData = res.data;
        }
      });
    },
  }
};
</script>
<style scoped>
.pagination {
  text-align: right;
  padding: 10px;
}
</style>